Skip to content

Conversation

@som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Nov 7, 2025

Fixes #24333

Specify deprecated aliases with deprecatedAliases. The message is "optional" (may be empty).

@Gedochao Gedochao added backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. needs-minor-release This PR cannot be merged until the next minor release labels Nov 7, 2025
@Gedochao Gedochao added this to the 3.8.0 milestone Nov 7, 2025
val Vprint: Setting[List[String]] = PhasesSetting(VerboseSetting, "Vprint", "Print out program after", aliases = List("-Xprint"))
val XshowPhases: Setting[Boolean] = BooleanSetting(VerboseSetting, "Vphases", "List compiler phases.", aliases = List("-Xshow-phases"))
val Vprint: Setting[List[String]] = PhasesSetting(VerboseSetting, "Vprint", "Print out program after", aliases = List("-Xprint*"))
val XshowPhases: Setting[Boolean] = BooleanSetting(VerboseSetting, "Vphases", "List compiler phases.", aliases = List("-Xshow-phases*"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be clearer to add a new list deprecatedAliases?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
that'd actually be more readable for when the API would be read outside of the compiler, as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, the people have spoken!

@som-snytt
Copy link
Contributor Author

som-snytt commented Nov 7, 2025

rando download error

Edit: followed by need to update shapeless-3 options.

@som-snytt
Copy link
Contributor Author

Technically, the number of parameters to a method should be capped at a gazillion, which was one reason to like the first, cute solution.

@som-snytt som-snytt marked this pull request as ready for review November 9, 2025 22:03
preferPrevious: Boolean = false,
propertyClass: Option[Class[?]] = None,
deprecation: Option[Deprecation] = None,
deprecatedAliases: List[(String, Deprecation)] = Nil,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: wouldn't it increase readability to have a

case class SettingAlias(name: String, deprecation: Option[Deprecation] = None)

?
or at the very least, use a named tuple here 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'm not accustomed to such fancy language features. I'll update it.

I found consolation in the thought that deprecated aliases are rare, and it's OK if they are awkward to write.

@Gedochao Gedochao requested a review from tgodzik November 12, 2025 07:29
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. needs-minor-release This PR cannot be merged until the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a deprecation mechanism for aliases of existing options

4 participants